/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Principal.java
 *
 * Created on 08/03/2011, 09:06:07
 */

package sisgraf.view;

import sisgraf.controler.ItemOrcamentoControler;
import sisgraf.controler.ServicoItemOrcamentoControler;
import sisgraf.controler.ServicoItemOrcamentoTabela;
import sisgraf.model.ItemOrcamento;
import sisgraf.model.ServicoItemOrcamento;

/**
 *
 * @author jordan
 */
public class ItemOrcamentos extends javax.swing.JDialog {
    private int opcao=0;
    private ServicoItemOrcamentoControler servicoItemOrcamentoControler =new ServicoItemOrcamentoControler();
    private ItemOrcamentoControler itemOrcamentoControler;
    private ServicoItemOrcamentoControler modeloControler =new ServicoItemOrcamentoControler();

    private ItemOrcamento itemOrcamento;
    private boolean incluiu=false;
    private boolean alterou=false;
    private boolean alterouServico=false;
    
    /** Creates new form Principal */
    public ItemOrcamentos(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }
    public void setOpcao(int opcao)
    {
        this.opcao = opcao;
        formComponentResized(null);
        setLocationRelativeTo(null);
        if (itemOrcamento.getOrcamento().getId()==null)
            jTxFdidOrcamento.setText("");
        else
            jTxFdidOrcamento.setText(itemOrcamento.getOrcamento().getId().toString());
        jTxFdNomCli.setText(itemOrcamento.getOrcamento().getCliente().getNom_cli());
        jTxFdNomVen.setText(itemOrcamento.getOrcamento().getVendedor().getNom_ven());
        jTxFdDataSolicitacao.setText(itemOrcamento.getOrcamento().getDataSolicitacaoForm());
        jTxFdDataEmissao.setText(itemOrcamento.getOrcamento().getDataEmissaoForm());
        jTxFdDataEncerramento.setText(itemOrcamento.getOrcamento().getDataEncerramentoForm());
        if (itemOrcamento.getId()==null)
            jTxFdidItemOrcamento.setText("");
        else jTxFdidItemOrcamento.setText(itemOrcamento.getId().toString());
        jTxFdDescricao.setText(itemOrcamento.getDescricao());
        if (itemOrcamento.getQuantidade()==null)
            jTxFdQuantidade.setText("");
        else jTxFdQuantidade.setText(itemOrcamento.getQuantidade().toString());
        jTxFdComprimento.setText(itemOrcamento.getComprimentoToString());
        jTxFdLargura.setText(itemOrcamento.getLarguraToString());
        jTxFdPrazoEntrega.setText(itemOrcamento.getPrazoEntregaForm());
        jTxFdDataAprovacao.setText(itemOrcamento.getDataAprovacaoForm());
        jTxFdDataCancelamento.setText(itemOrcamento.getDataCancelamentoForm());
        jTbVisualizacao.setModel(servicoItemOrcamentoControler.getSetListarServicoItemOrcamento(itemOrcamento.getServicoItemOrcamento()));
        servicoItemOrcamentoControler.ajustarTabela(jTbVisualizacao);
        jTxFdValorTotal.setText(itemOrcamento.getValorForm());
        if (this.opcao == Menu.OP_PESQ_ALT){
        } else {
        }
        setVisible(true);
        jTxFdDescricao.setFocusable(true);
    }

    public void setItemOrcamento(ItemOrcamento itemOrcamento){
        this.itemOrcamento = itemOrcamento;
    }
    public ItemOrcamento getItemOrcamento(){
        return this.itemOrcamento;
    }
    public void setControler(ItemOrcamentoControler itemOrcamentoControler){
        this.itemOrcamentoControler = itemOrcamentoControler;
    }
    public boolean getIncluiu(){
        return this.incluiu;
    }
    public boolean getAlterou(){
        return this.alterou;
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPnlSuperior = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jPnlCentral = new javax.swing.JPanel();
        jPnlConteudo = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jTxFdidOrcamento = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jTxFdNomCli = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jTxFdNomVen = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jTxFdDataSolicitacao = new javax.swing.JFormattedTextField();
        jLabel9 = new javax.swing.JLabel();
        jTxFdDataEmissao = new javax.swing.JFormattedTextField();
        jLabel10 = new javax.swing.JLabel();
        jTxFdDataEncerramento = new javax.swing.JFormattedTextField();
        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        jTxFdidItemOrcamento = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jTxFdDescricao = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jTxFdQuantidade = new javax.swing.JFormattedTextField();
        jTxFdDataAprovacao = new javax.swing.JFormattedTextField();
        jTxFdComprimento = new javax.swing.JFormattedTextField();
        jTxFdLargura = new javax.swing.JFormattedTextField();
        jTxFdPrazoEntrega = new javax.swing.JFormattedTextField();
        jTxFdDataCancelamento = new javax.swing.JFormattedTextField();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTbVisualizacao = new javax.swing.JTable();
        jBtIncluir = new javax.swing.JButton();
        jBtAlterar = new javax.swing.JButton();
        jBtExcluir = new javax.swing.JButton();
        jLabel19 = new javax.swing.JLabel();
        jTxFdValorTotal = new javax.swing.JFormattedTextField();
        jPnlControle = new javax.swing.JPanel();
        jBtConfirmar = new javax.swing.JButton();
        jBtFinalizar = new javax.swing.JButton();
        jPnlInferior = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentResized(java.awt.event.ComponentEvent evt) {
                formComponentResized(evt);
            }
        });

        jPnlSuperior.setBorder(new javax.swing.border.MatteBorder(null));

        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("SISTEMA DE ORÇAMENTOS PARA SERVIÇOS GRAFICOS");
        jLabel1.setMinimumSize(new java.awt.Dimension(0, 14));

        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel2.setText("Inclusão de Serviços no Orçamento");
        jLabel2.setMinimumSize(new java.awt.Dimension(0, 14));

        javax.swing.GroupLayout jPnlSuperiorLayout = new javax.swing.GroupLayout(jPnlSuperior);
        jPnlSuperior.setLayout(jPnlSuperiorLayout);
        jPnlSuperiorLayout.setHorizontalGroup(
            jPnlSuperiorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 704, Short.MAX_VALUE)
            .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 704, Short.MAX_VALUE)
        );
        jPnlSuperiorLayout.setVerticalGroup(
            jPnlSuperiorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlSuperiorLayout.createSequentialGroup()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPnlCentral.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jPnlCentral.setMinimumSize(new java.awt.Dimension(100, 0));

        jPnlConteudo.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jLabel5.setText("Número:");

        jTxFdidOrcamento.setEnabled(false);

        jLabel6.setText("Cliente:");

        jTxFdNomCli.setEnabled(false);

        jLabel7.setText("Vendedor:");

        jTxFdNomVen.setEnabled(false);

        jLabel8.setText("Data de Solicitação:");

        try {
            jTxFdDataSolicitacao.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jTxFdDataSolicitacao.setEnabled(false);

        jLabel9.setText("Data de Emissão:");

        try {
            jTxFdDataEmissao.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jTxFdDataEmissao.setEnabled(false);

        jLabel10.setText("Data de Encerramento:");

        try {
            jTxFdDataEncerramento.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jTxFdDataEncerramento.setEnabled(false);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Serviço", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(0, 0, 0))); // NOI18N

        jPanel2.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jLabel11.setText("Item de Serviço:");

        jTxFdidItemOrcamento.setEnabled(false);

        jLabel12.setText("Descrição:");

        jLabel13.setText("Quantidade:");

        jLabel14.setText("Comp.:");

        jLabel15.setText("Larg.:");

        jLabel16.setText("Prazo de Entrega:");

        jLabel17.setText("Dt. Aprovação:");

        jLabel18.setText("Dt. Cancelamento:");

        jTxFdQuantidade.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#,##0"))));
        jTxFdQuantidade.setHorizontalAlignment(javax.swing.JTextField.RIGHT);

        try {
            jTxFdDataAprovacao.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        jTxFdComprimento.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#,##0"))));
        jTxFdComprimento.setHorizontalAlignment(javax.swing.JTextField.RIGHT);

        jTxFdLargura.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#,##0"))));
        jTxFdLargura.setHorizontalAlignment(javax.swing.JTextField.RIGHT);

        try {
            jTxFdPrazoEntrega.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        try {
            jTxFdDataCancelamento.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel11)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTxFdidItemOrcamento, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTxFdDescricao, javax.swing.GroupLayout.DEFAULT_SIZE, 316, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel13))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel14)
                        .addGap(2, 2, 2)
                        .addComponent(jTxFdComprimento, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTxFdLargura, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel16)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTxFdPrazoEntrega, javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel17)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTxFdDataAprovacao, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel18)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jTxFdDataCancelamento)
                    .addComponent(jTxFdQuantidade, javax.swing.GroupLayout.DEFAULT_SIZE, 67, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(jTxFdidItemOrcamento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel12)
                    .addComponent(jTxFdDescricao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13)
                    .addComponent(jTxFdQuantidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(jLabel15)
                    .addComponent(jTxFdComprimento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTxFdLargura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTxFdDataCancelamento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18)
                    .addComponent(jTxFdDataAprovacao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel17)
                    .addComponent(jTxFdPrazoEntrega, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel16))
                .addContainerGap(8, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Composição do Serviço", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(0, 0, 0))); // NOI18N

        jTbVisualizacao.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jTbVisualizacao);

        jBtIncluir.setText("Incluir");
        jBtIncluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtIncluirActionPerformed(evt);
            }
        });

        jBtAlterar.setText("Alterar");
        jBtAlterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtAlterarActionPerformed(evt);
            }
        });

        jBtExcluir.setText("Excluir");
        jBtExcluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtExcluirActionPerformed(evt);
            }
        });

        jLabel19.setText("Total do Serviço:");

        jTxFdValorTotal.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        jTxFdValorTotal.setEnabled(false);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jBtIncluir)
                .addGap(18, 18, 18)
                .addComponent(jBtAlterar)
                .addGap(18, 18, 18)
                .addComponent(jBtExcluir)
                .addGap(18, 18, 18)
                .addComponent(jLabel19)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTxFdValorTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 680, Short.MAX_VALUE)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 123, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTxFdValorTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel19)
                    .addComponent(jBtExcluir)
                    .addComponent(jBtAlterar)
                    .addComponent(jBtIncluir)))
        );

        javax.swing.GroupLayout jPnlConteudoLayout = new javax.swing.GroupLayout(jPnlConteudo);
        jPnlConteudo.setLayout(jPnlConteudoLayout);
        jPnlConteudoLayout.setHorizontalGroup(
            jPnlConteudoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlConteudoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPnlConteudoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPnlConteudoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(jPnlConteudoLayout.createSequentialGroup()
                            .addComponent(jLabel5)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jTxFdidOrcamento, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addComponent(jLabel6)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jTxFdNomCli, javax.swing.GroupLayout.PREFERRED_SIZE, 494, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPnlConteudoLayout.createSequentialGroup()
                            .addComponent(jLabel7)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jTxFdNomVen)
                            .addGap(18, 18, 18)
                            .addComponent(jLabel8)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jTxFdDataSolicitacao, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPnlConteudoLayout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTxFdDataEmissao, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTxFdDataEncerramento, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(26, Short.MAX_VALUE))
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPnlConteudoLayout.setVerticalGroup(
            jPnlConteudoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlConteudoLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPnlConteudoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jTxFdidOrcamento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(jTxFdNomCli, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPnlConteudoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jTxFdNomVen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTxFdDataSolicitacao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPnlConteudoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(jTxFdDataEmissao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10)
                    .addComponent(jTxFdDataEncerramento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPnlControle.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jBtConfirmar.setText("Confirmar");
        jBtConfirmar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtConfirmarActionPerformed(evt);
            }
        });

        jBtFinalizar.setText("Finalizar");
        jBtFinalizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtFinalizarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPnlControleLayout = new javax.swing.GroupLayout(jPnlControle);
        jPnlControle.setLayout(jPnlControleLayout);
        jPnlControleLayout.setHorizontalGroup(
            jPnlControleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPnlControleLayout.createSequentialGroup()
                .addContainerGap(534, Short.MAX_VALUE)
                .addComponent(jBtConfirmar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jBtFinalizar)
                .addContainerGap())
        );
        jPnlControleLayout.setVerticalGroup(
            jPnlControleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlControleLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPnlControleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBtFinalizar)
                    .addComponent(jBtConfirmar))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPnlCentralLayout = new javax.swing.GroupLayout(jPnlCentral);
        jPnlCentral.setLayout(jPnlCentralLayout);
        jPnlCentralLayout.setHorizontalGroup(
            jPnlCentralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPnlConteudo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPnlControle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPnlCentralLayout.setVerticalGroup(
            jPnlCentralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlCentralLayout.createSequentialGroup()
                .addComponent(jPnlConteudo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPnlControle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPnlInferior.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel3.setText("Gráfica Modêlo");

        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel4.setText("Grupo de Estudo PMA Anhanguera");

        javax.swing.GroupLayout jPnlInferiorLayout = new javax.swing.GroupLayout(jPnlInferior);
        jPnlInferior.setLayout(jPnlInferiorLayout);
        jPnlInferiorLayout.setHorizontalGroup(
            jPnlInferiorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPnlInferiorLayout.createSequentialGroup()
                .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 386, Short.MAX_VALUE)
                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPnlInferiorLayout.setVerticalGroup(
            jPnlInferiorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlInferiorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel3))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPnlSuperior, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPnlInferior, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPnlCentral, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPnlSuperior, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPnlCentral, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPnlInferior, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    
    private void formComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentResized
        // TODO add your handling code here:
        int dif = this.getHeight()-jPnlSuperior.getHeight()-jPnlCentral.getHeight()-jPnlInferior.getHeight()-6;
        jPnlCentral.setSize(this.getWidth(),this.getHeight()-jPnlSuperior.getHeight()-jPnlInferior.getHeight()-dif);
        jPnlConteudo.setSize(jPnlCentral.getWidth(),jPnlCentral.getHeight()-jPnlControle.getHeight());
        jPnlControle.setSize(jPnlCentral.getWidth(), jPnlControle.getHeight());
        jPnlControle.setLocation(0, jPnlConteudo.getHeight());
    }//GEN-LAST:event_formComponentResized

    private void jBtIncluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtIncluirActionPerformed
        // TODO add your handling code here:
        String ErroMensagem="";
        if (this.opcao == Menu.OP_PESQ_INC)
        {
            try{
                ErroMensagem="Infome a Descrição";
                this.itemOrcamento.setDescricao(jTxFdDescricao.getText());
                ErroMensagem="Infome a Quantidade";
                this.itemOrcamento.setQuantidade(Integer.parseInt(jTxFdQuantidade.getText()));
                ErroMensagem="Infome o comprimento";
                this.itemOrcamento.setComprimento(Short.parseShort(jTxFdComprimento.getText()));
                ErroMensagem="Infome a Largura";
                this.itemOrcamento.setLargura(Short.parseShort(jTxFdLargura.getText()));
                ErroMensagem="Infome o Prazo de Entrega";
                this.itemOrcamento.setPrazoEntrega(jTxFdPrazoEntrega.getText());
                ErroMensagem="Infome a Data de Aprovação";
                this.itemOrcamento.setDataAprovacao(jTxFdDataAprovacao.getText());
                ErroMensagem="Infome a Data de Cancelamento";
                this.itemOrcamento.setDataCancelamento(jTxFdDataCancelamento.getText());
                ErroMensagem="";
            } catch (Exception ex){

                javax.swing.JOptionPane.showMessageDialog(null, ErroMensagem , "Erro no dados informados", javax.swing.JOptionPane.INFORMATION_MESSAGE);
            }
        }
        ServicoItemOrcamentos servicoItemOrcamentos = new ServicoItemOrcamentos(new javax.swing.JFrame(), true);
        ServicoItemOrcamento servicoItemOrcamento = new ServicoItemOrcamento();
        // Inserir inicialização das propriedades do objeto itemOrcamento
        servicoItemOrcamento.setOrcamento(itemOrcamento.getOrcamento());
        servicoItemOrcamento.setItemOrcamento(itemOrcamento);
        servicoItemOrcamentos.setServicoItemOrcamento(servicoItemOrcamento);
        servicoItemOrcamentos.setControler(modeloControler);
        servicoItemOrcamentos.setOpcao(Menu.OP_PESQ_INC);
        if (servicoItemOrcamentos.getIncluiu()){
            alterouServico=true;
            itemOrcamento.setServicoItemOrcamento(servicoItemOrcamentos.getServicoItemOrcamento());
        }
        jTbVisualizacao.setModel(servicoItemOrcamentoControler.getSetListarServicoItemOrcamento(itemOrcamento.getServicoItemOrcamento()));
        servicoItemOrcamentoControler.ajustarTabela(jTbVisualizacao);
        jTxFdValorTotal.setText(itemOrcamento.getValorForm());
    }//GEN-LAST:event_jBtIncluirActionPerformed

    private void jBtAlterarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtAlterarActionPerformed
        // TODO add your handling code here:
        if (jTbVisualizacao.getSelectedRow()>=0) {
            int linha = jTbVisualizacao.getSelectedRow();
            ServicoItemOrcamentoTabela modelo = (ServicoItemOrcamentoTabela) jTbVisualizacao.getModel();
            int id = modelo.getServicoItemOrcamento(linha).getId();
            ServicoItemOrcamento servicoItemOrcamento = itemOrcamento.getServicoItemOrcamento(id);
            if (itemOrcamento!=null){
                String ErroMensagem="";
                try{
                    ErroMensagem="Infome a Descrição";
                    this.itemOrcamento.setDescricao(jTxFdDescricao.getText());
                    ErroMensagem="Infome a Quantidade";
                    this.itemOrcamento.setQuantidade(Integer.parseInt(jTxFdQuantidade.getText()));
                    ErroMensagem="Infome o comprimento";
                    this.itemOrcamento.setComprimento(Short.parseShort(jTxFdComprimento.getText()));
                    ErroMensagem="Infome a Largura";
                    this.itemOrcamento.setLargura(Short.parseShort(jTxFdLargura.getText()));
                    ErroMensagem="Infome o Prazo de Entrega";
                    this.itemOrcamento.setPrazoEntrega(jTxFdPrazoEntrega.getText());
                    ErroMensagem="Infome a Data de Aprovação";
                    this.itemOrcamento.setDataAprovacao(jTxFdDataAprovacao.getText());
                    ErroMensagem="Infome a Data de Cancelamento";
                    this.itemOrcamento.setDataCancelamento(jTxFdDataCancelamento.getText());
                    ErroMensagem="";
                } catch (Exception ex){

                    javax.swing.JOptionPane.showMessageDialog(null, ErroMensagem , "Erro no dados informados", javax.swing.JOptionPane.INFORMATION_MESSAGE);
                }
                ServicoItemOrcamentos servicoItemOrcamentos = new ServicoItemOrcamentos(new javax.swing.JFrame(), true);
                servicoItemOrcamentos.setServicoItemOrcamento(servicoItemOrcamento);
                servicoItemOrcamentos.setControler(modeloControler);
                servicoItemOrcamentos.setOpcao(Menu.OP_PESQ_ALT);
                alterouServico=servicoItemOrcamentos.getAlterou();
                servicoItemOrcamentos.dispose();
                jTbVisualizacao.setModel(servicoItemOrcamentoControler.getSetListarServicoItemOrcamento(itemOrcamento.getServicoItemOrcamento()));
                servicoItemOrcamentoControler.ajustarTabela(jTbVisualizacao);
                jTxFdValorTotal.setText(itemOrcamento.getValorForm());
            } else {
                javax.swing.JOptionPane.showMessageDialog(null, "Erro ao preparar Composição do Serviço do Orcçamento para alteração" , "Acesso ao Banco de Dados", javax.swing.JOptionPane.INFORMATION_MESSAGE);
            }
        } else {
            javax.swing.JOptionPane.showMessageDialog(null, "É necessário Selecionar um Composição Serviço do Orçamento para Alteração", "Informação de Alteração", javax.swing.JOptionPane.INFORMATION_MESSAGE);
        }

    }//GEN-LAST:event_jBtAlterarActionPerformed

    private void jBtExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtExcluirActionPerformed
        // TODO add your handling code here:
        if (jTbVisualizacao.getSelectedRow()>=0) {
            if (javax.swing.JOptionPane.showConfirmDialog(null,"Confirma Exclusão da Composição de Seviço Selecionada ?", "Confirmar Exclusão", javax.swing.JOptionPane.YES_NO_OPTION)==0){
                int linha = jTbVisualizacao.getSelectedRow();
                ServicoItemOrcamentoTabela modelo = (ServicoItemOrcamentoTabela) jTbVisualizacao.getModel();
                int id = modelo.getServicoItemOrcamento(linha).getId();
                if (!itemOrcamento.excluiServicoItemOrcamento(id)){
                    javax.swing.JOptionPane.showMessageDialog(null, "Erro ao preparar Composição do Serviço do Orcçamento para exclusão" , "Acesso ao Banco de Dados", javax.swing.JOptionPane.INFORMATION_MESSAGE);
                } else {
                    alterouServico=true;
                    jTbVisualizacao.setModel(servicoItemOrcamentoControler.getSetListarServicoItemOrcamento(itemOrcamento.getServicoItemOrcamento()));
                    servicoItemOrcamentoControler.ajustarTabela(jTbVisualizacao);
                    jTxFdValorTotal.setText(itemOrcamento.getValorForm());
                }
            }
        } else {
            javax.swing.JOptionPane.showMessageDialog(null, "É necessário Selecionar um Composição Serviço do Orçamento para Alteração", "Informação de Exclusão", javax.swing.JOptionPane.INFORMATION_MESSAGE);
        }
    }//GEN-LAST:event_jBtExcluirActionPerformed

    private void jBtFinalizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtFinalizarActionPerformed
        // TODO add your handling code here:
        boolean alterado =false;
        // Testa comprimento
        /*
         *
        if (!this.itemOrcamento.getComprimentoToString().replace('.', ',').equals(jTxFdComprimento.getText())||
            !this.itemOrcamento.getLarguraToString().replace('.', ',').equals(jTxFdLargura.getText())||
            !this.itemOrcamento.getDataAprovacaoForm().equals(jTxFdDataAprovacao.getText())||
            !this.itemOrcamento.getDataCancelamentoForm().equals(jTxFdDataCancelamento.getText())||
            !this.itemOrcamento.getDescricao().equals(jTxFdDescricao.getText())||
            !this.itemOrcamento.getPrazoEntregaForm().equals(jTxFdPrazoEntrega.getText())
            )
            alterado=true;
         */
        
        if (this.itemOrcamento.getQuantidade()!=null){
           if (!this.itemOrcamento.getQuantidade().toString().equals(jTxFdQuantidade.getText())){
               alterado=true;
           }
        } else {
            if (!jTxFdQuantidade.getText().equals("")) alterado = true;
        }
        if (alterado||alterouServico){
            if (javax.swing.JOptionPane.showConfirmDialog(null,
                    "Modificações foram feitas, deseja realmente finalizar sem salvar ?\nSerão perdidas as alterações feitas, inclusive da composição de serviço",
                    "Finalizar", javax.swing.JOptionPane.YES_NO_OPTION)==0){
               this.setVisible(false);
            }
        } else this.setVisible(false);
        /*
         *
        if (!servicoItemOrcamento.getNumeroAplicacoesToString().equals(jTxFdNumeroAplicacoes.getText()))
            alterado=true;
        if (this.itemOrcamento.getQuantidade()!=null){
           if (!this.itemOrcamento.getQuantidade().equals(jTxFdQuantidade.getText())){
               alterado=true;
           }
        } else {
            if (!jTxFdQuantidade.getText().equals("")) alterado = true;
        }
         */

    }//GEN-LAST:event_jBtFinalizarActionPerformed

    private void jBtConfirmarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtConfirmarActionPerformed
        // TODO add your handling code here:
        String mensagem="";
        boolean erros = false;
        if (jTxFdDescricao.getText().equals("")){
            mensagem = mensagem + "\nInforme a descrição do serviço";
            erros=true;
        }
        if (jTxFdQuantidade.getText().equals("")){
            mensagem = mensagem + "\nInforme a quantidade do serviço";
            erros=true;
        }
        if (jTxFdComprimento.getText().equals("")){
            mensagem = mensagem + "\nInforme o comprimento";
            erros=true;
        }
        if (jTxFdLargura.getText().equals("")){
            mensagem = mensagem + "\nInforme a largura";
            erros=true;
        }
        if (jTxFdPrazoEntrega.getText().equals("")){
            mensagem = mensagem + "\nInforme o prazo de entrega";
            erros=true;
        }
        if (!erros){
            this.itemOrcamento.setDescricao(jTxFdDescricao.getText());
            this.itemOrcamento.setQuantidade(Integer.parseInt(jTxFdQuantidade.getText()));
            this.itemOrcamento.setComprimento(Short.parseShort(jTxFdComprimento.getText()));
            this.itemOrcamento.setLargura(Short.parseShort(jTxFdLargura.getText()));
            this.itemOrcamento.setPrazoEntrega(jTxFdPrazoEntrega.getText());
            this.itemOrcamento.setDataAprovacao(jTxFdDataAprovacao.getText());
            this.itemOrcamento.setDataCancelamento(jTxFdDataCancelamento.getText());
            if (this.opcao == Menu.OP_PESQ_INC){
                incluiu=true;
            } alterou=true;
            this.setVisible(false);
        } else {
           javax.swing.JOptionPane.showMessageDialog(null,
                   "Ocorreram os seguintes erros ao serem confirmados os dados\n"+
                   mensagem+"\n"
                   + "Corrija as informações listadas e tente confirmar novamente ",
                   "Acesso ao Banco de Dados", javax.swing.JOptionPane.INFORMATION_MESSAGE);
        }

    }//GEN-LAST:event_jBtConfirmarActionPerformed
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                Principal dialog = new Principal(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBtAlterar;
    private javax.swing.JButton jBtConfirmar;
    private javax.swing.JButton jBtExcluir;
    private javax.swing.JButton jBtFinalizar;
    private javax.swing.JButton jBtIncluir;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPnlCentral;
    private javax.swing.JPanel jPnlConteudo;
    private javax.swing.JPanel jPnlControle;
    private javax.swing.JPanel jPnlInferior;
    private javax.swing.JPanel jPnlSuperior;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTbVisualizacao;
    private javax.swing.JFormattedTextField jTxFdComprimento;
    private javax.swing.JFormattedTextField jTxFdDataAprovacao;
    private javax.swing.JFormattedTextField jTxFdDataCancelamento;
    private javax.swing.JFormattedTextField jTxFdDataEmissao;
    private javax.swing.JFormattedTextField jTxFdDataEncerramento;
    private javax.swing.JFormattedTextField jTxFdDataSolicitacao;
    private javax.swing.JTextField jTxFdDescricao;
    private javax.swing.JFormattedTextField jTxFdLargura;
    private javax.swing.JTextField jTxFdNomCli;
    private javax.swing.JTextField jTxFdNomVen;
    private javax.swing.JFormattedTextField jTxFdPrazoEntrega;
    private javax.swing.JFormattedTextField jTxFdQuantidade;
    private javax.swing.JFormattedTextField jTxFdValorTotal;
    private javax.swing.JTextField jTxFdidItemOrcamento;
    private javax.swing.JTextField jTxFdidOrcamento;
    // End of variables declaration//GEN-END:variables
    
}
